package com.hlf.modules.merchant.order.mapper;

import com.hlf.common.utils.Query;
import com.hlf.modules.base.mapper.BaseMapper;
import com.hlf.modules.merchant.order.entity.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface OrderMapper  extends BaseMapper<Order> {

    int queryTotalForStoreId(Query query, Long storeId);

    List<Order> queryListForStoreId(Query query, Long storeId);

    int queryTotalForMerchantId(Query query, Long merchantId);

    List<Order> queryListForMerchantId(Query query, Long merchantId);

    int insertSelective(Order order);

    int updateByPrimaryKeySelective(Order order);

    int updateByOrderNumSelective(Order record);

    int updateByPrimaryKey(Order record);

    List<Order> queryDepthForTableId(@Param("tableId") Long tableId);

    int queryTotalForTableId(@Param("tableId") Long tableId);

    List<Order> queryListForOrderNum(@Param("orderNum") Long orderNum);

    List<Order> queryDepthForStoreId(Long storeId);

    List<Order> queryListByStoreIdAndToday(@Param("storeId") String storeId);

    /**
     * 分页查所有
     * @param map
     * @return
     */
    List<Order> queryOrderAllListPageByStoreId(Map<String, Object> map);

    /**
     * 分页查(根据状态)
     * @param map
     * @return
     */
    List<Order> queryOrderListPageByStoreId(Map<String, Object> map);
}